package router

import (
	"github.com/gogf/gf/net/ghttp"
)

func regHome(s *ghttp.Server, versionName, defaultVersionName string) {
	// 路由前缀
	/*routerPrefix := "/"
	s.Group(routerPrefix, func(group *ghttp.RouterGroup) {
		var leftJoin []*BaseReq.QueryOpLeftJoin
		dbPrefix := g.Cfg().GetString("database.prefix")
		leftJoin = append(leftJoin, &BaseReq.QueryOpLeftJoin{
			TableInfo: dbPrefix + "test_store ts",
			Condition: "t.store_id = ts.id",
		})
		hc := controllers.NewHomeController(&BaseReq.I{
			TableName:          "test",
			InfoIgnoreProperty: "update_at,delete_at", // info 时过滤
			PageQueryOp: &BaseReq.QueryOp{
				KeyWordLikeFields: g.ArrayStr{"name", "text1"},
			},
			ListQueryOp: &BaseReq.QueryOp{
				//KeyWordLikeFields: g.ArrayStr{"name", "text1"},
				//FieldsEq:          g.ArrayStr{"id"},
				OtherWhere: func(r *ghttp.Request) g.Map {
					return g.Map{
						"id >": 0,
					}
				},
				//SelectFields: g.ArrayStr{"t.*", "ts.store_name"},
				//AsName: "t",
				//LeftJoin: leftJoin,
				//OrderBy: "id DESC",
			},
			AddInsertData: func(r *ghttp.Request) g.Map {
				return map[string]interface{}{
					"store_id": 1,
				}
			},
		})
		homeControllerMaps := map[string]interface{}{
			"1.0.0": hc,
		}
		// 登陆
		group.POST("/login", func(r *ghttp.Request) {
			BindHandlerVersion(r, versionName, homeControllerMaps, defaultVersionName, "Login")
		})
		// 注册基础方法
		regBase([]string{
			"add",
			"delete",
			"update",
			"info",
			"list",
			"page",
		}, group, homeControllerMaps, versionName, defaultVersionName)
	})*/
}
